package com.study.csc.a13waitandnotify;

/**
 * @author csc
 * @Date 2023/10/21 16:59
 * @PackageName:com.study.csc.a13waitandnotify
 * @ClassName: ThreadDemo
 * @Description: TODO
 * @Version 1.0
 */
public class ThreadDemo {

    public static void main(String[] args) {

        /*
           需求:  完成生产者和消费者(等待唤醒机制)的代码
                  实现线程轮流交替执行的效果
         */
        Cook c = new Cook();
        Foodie f = new Foodie();

        //给线程设置名字
        c.setName("厨师");
        f.setName("吃货");

        //开启线程
        c.start();
        f.start();




    }

}
